***Set directory to the Replicationgovernance\finkelextension folder

cd "C:\Users\sam2334\Dropbox\vdem-aid\ReplicationGovernance\Finkelextension"

* .do file to generate finkel replications for 2001 to 2018, as Finkel et al 2007's dataset has several incompatabilities with current data that do not allow appending to their data and running together in any sensible fashion, so this is a new analysis.

use "finkelreplicationdata20012018.dta"

xtset country_id year

*Turn these variables that are dollar variables into millions of dollars to make coefficients more presentable

gen USAIDdgconstant2016millions = USAIDdgconstant2016repeat/1000000
gen USAIDnondgconstant2016millions = USAIDnondgconstant2016repeat/1000000 
gen nonUSAIDconstant2016millions = nonUSAIDconstant2016repeat/1000000 
gen regionaldgmillions = regionaldg/1000000 
gen regionalnondgmillions = regionalnondg/1000000 

*crossed fe eschews the need for the static variables.  Following models are presented in the appendix as Tables 10-12, Models 17-28

*Models 1-3 cannot be replicated because we don't have an analagous elections category in the new data

*Models 4-5 are DG-->micro electoral data suffrage/participation

*MODEL 17: Registry

xtreg v2elrgstry year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*MODEL 18: suffrage %

xtreg v2asuffrage year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Models 19-20 are DG-->EMB autonomy and capacity

*MODEL 19: EMB autonomy
 
xtreg v2elembaut year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*MODEL 20: EMB capacity 3.1.7---no result, correct direction

xtreg v2elembcap year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Predicting broader measures of electoral quality

*MODEL 21: Vote buying

xtreg v2elvotbuy year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 22: electoral irregularities

xtreg v2elirreg year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 23: Government intimidation

xtreg v2elintim year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 24: other electoral violence

xtreg v2elpeace year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 25: party system variable

xtreg v2elmulpar year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 26: Free Fair elections 2.2.6

xtreg v2xel_frefair year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 27: Polyarchy/institutional def democracy

xtreg v2x_polyarchy year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

*Model 28: lib democracy definition---positive, significant (.016)

xtreg v2x_libdem year USAIDdgconstant2016millions USAIDnondgconstant2016millions nonUSAIDconstant2016millions regionaldgmillions regionalnondgmillions othercountrydgoda othercountrynondgoda i.year if income_group_id<4, fe

